package org.hfy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 外发加工状态枚举
 */
@Getter
@AllArgsConstructor
public enum OutsourcingStatus {
    OUTSOURCED("已外发", "已外发"),
    PROCESSING("加工中", "加工中"),
    RETURNED("已回厂", "已回厂"),
    CANCELLED("已取消", "已取消");

    private final String code;
    private final String description;

    public static OutsourcingStatus fromCode(String code) {
        for (OutsourcingStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return OUTSOURCED; // 默认返回已外发状态
    }
} 